package com.dk.controller;

import com.dk.data.Result;
import com.dk.em.ResultEnum;
import com.dk.service.IDtFansService;
import com.dk.util.JwtUtil;
import com.dk.vo.DtItemVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("concernController")
@Api(value = "关注展示接口")
public class ConcernController {
    @Resource
    private IDtFansService fansService;
    @Autowired
    private JwtUtil jwtUtil;

    @PostMapping
    @ApiIgnore(value = "关注展示并进行分页")
    @ApiImplicitParams({
            @ApiImplicitParam( name = "uid",value = "关注用户id",required = true,paramType = "query"),
            @ApiImplicitParam( name = "pageSize",value = "每页条数",required = true,paramType = "query"),
            @ApiImplicitParam( name = "pageNumber",value = "当前页",required = true,paramType = "query"),
    })
    public Result concernDisplay(@RequestParam("uid")Integer uid,
                                 @RequestParam("pageSize")Integer pageSize,
                                 @RequestParam("pageNumber")Integer pageNumber){
        List<DtItemVO> concernList = fansService.selectByConcern(uid,pageNumber,pageSize);
        return Result.response(ResultEnum.SUCCESS).setData(concernList);
    }
}
